# Locate Antlr

# start with 'not found'

SET( ANTLR_FOUND 0 CACHE BOOL "Do we have Antlr?" )

FIND_PATH(ANTLR_INCLUDE_DIR antlr/config.hpp /usr/include /opt/antlr/include)

FIND_PATH(ANTLR_STATIC_LIB_DIR libantlr.a /usr/lib /opt/antlr/lib)

FIND_PROGRAM(ANTLR_COMPILER antlr /usr/bin /opt/antlr/bin)

IF ( ANTLR_INCLUDE_DIR)
    SET( ANTLR_FOUND 1 CACHE BOOL "Do we have Antlr?" FORCE )
    SET( ANTLR_INCLUDES ${ANTLR_INCLUDE_DIR} )
    SET( ANTLR_STATIC_LIB ${ANTLR_STATIC_LIB_DIR}/libantlr.a )
    SET( ANTLR_COMMAND ${ANTLR_COMPILER} )

 MESSAGE( STATUS "DEBUG: antlr/config.hpp is apparently found in : ${ANTLR_INCLUDE_DIR}" )
 MESSAGE( STATUS "DEBUG: libantlr.a is apparently found in : ${ANTLR_STATIC_LIB_DIR}" )
 MESSAGE( STATUS "DEBUG: antlr compiler is apparently found in : ${ANTLR_COMPILER}" )
ENDIF( ANTLR_INCLUDE_DIR )

